def a(count,p):
	begin = p-5
	end = p+4
	if p<6:
		begin = 1
		end = 10
	if count < 10:
		begin = 1
		end = count
	if p>count-5:
		begin = count-9
		end = count
	for i in range(begin,end+1):
		print(i)


a(10,8)